{include file="public/layout" /}

<body class="bodystyle" style="overflow-y: scroll;">
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
{include file="system/left" /}
<div class="page" style="min-width:auto;margin-left:100px;">
    <div class="flexigrid htitx">
        <form class="form-horizontal" id="post_form" action="{:url('Shop/conf')}" method="post">
            <div class="ncap-form-default pt0">
            <div class="hDiv">
                <div class="hDivBox">
                    <table cellspacing="0" cellpadding="0" style="width: 100%">
                        <thead>
                            <tr>
                                <th class="w10"><div class="tc"></div></th>
                                <th class="w10"><div class="tc">基本设置</div></th>
                                <th ><div></div></th>
                            </tr>
                        </thead>
                    </table>
                </div>
            </div>
            <dl class="row">
                <dt class="tit"> <label for="goods_unit">商品单位</label> </dt>
                <dd class="opt">
                    <input type="text" id="goods_unit" name="goods[goods_unit]" value="{$usersConfig.goods_unit|default='件'}"/>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit"> <label for="goods_stock_warning">商品库存预警</label> </dt>
                <dd class="opt">
                    <input type="text" id="goods_stock_warning" name="goods[goods_stock_warning]" value="{$usersConfig.goods_stock_warning|default='0'}" maxlength="4" onkeyup="this.value=this.value.replace(/^\D*([0-9]\d*)?.*$/,'$1');"/><span class="ml10">{$usersConfig.goods_unit}</span>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit"> <label>显示划线价</label> </dt>
                <dd class="opt">
                    <label><input type="radio" name="goods[goods_crossed_price]" value="1" {if condition="!empty($userConfig.goods_crossed_price)"} checked="checked" {/if}/>开启</label>
                    &nbsp;&nbsp;&nbsp;
                    <label><input type="radio" name="goods[goods_crossed_price]" value="0" {if condition="empty($userConfig.goods_crossed_price)"} checked="checked" {/if}/>关闭</label>
                </dd>
            </dl>
            <dl class="row none">
                <dt class="tit"> <label>货到付款</label> </dt>
                <dd class="opt">
                    <label><input type="radio" name="shop[shop_open_offline]" value="0" {if condition="!isset($userConfig.shop_open_offline) || empty($userConfig.shop_open_offline)"} checked="checked" {/if}/>开启</label>
                    &nbsp;&nbsp;&nbsp;
                    <label><input type="radio" name="shop[shop_open_offline]" value="1" {if condition="$userConfig.shop_open_offline == 1"} checked="checked" {/if}/>关闭</label>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit"> <label>运费模板</label> </dt>
                <dd class="opt" style="line-height: 30px;">
                    <label>
                        <input type="radio" name="shop[shop_open_shipping]" value="0" {if condition="!isset($userConfig.shop_open_shipping) || empty($userConfig.shop_open_shipping)"} checked="checked" {/if}/>包邮
                    </label>
                    &nbsp;&nbsp;&nbsp;
                    <label>
                        <input type="radio" name="shop[shop_open_shipping]" value="1" {if condition="$userConfig.shop_open_shipping == 1"} checked="checked" {/if}/>需要运费
                        &nbsp;<a id="a_shop_open_shipping" href="javascript:void(0);" onclick="setShipping();" class="ncap-btn ncap-btn-green" {if condition="!isset($userConfig.shop_open_shipping) || empty($userConfig.shop_open_shipping)"} style="display: none;" {/if}>设置价格</a>
                    </label>
                </dd>
            </dl>
            <script type="text/javascript">
                $(function() {
                    $('input[name="shop[shop_open_shipping]"]').click(function() {
                        var shop_open_shipping = $(this).val();
                        $('#a_shop_open_shipping').hide();
                        if (1 === parseInt(shop_open_shipping)) $('#a_shop_open_shipping').show();
                    });
                });

                function setShipping() {
                    //iframe窗
                    layer.open({
                        type: 2,
                        title: '运费模板管理',
                        move: false,
                        shadeClose: false,
                        maxmin: false, //开启最大化最小化按钮
                        shade: layer_shade,
                        closeBtn: 3,
                        area: ['60%', '80%'],
                        content: "{:url('Shop/shipping_template')}"
                    });
                }
            </script>
            <dl class="row">
                <dt class="tit"> <label>快递公司</label> </dt>
                <dd class="opt">
                    已选择 <i class="red" id="expressSelectNum">{$expressSelectNum}</i> 家&nbsp;&nbsp;&nbsp;
                    <a href="javascript:void(0);" onclick="selectExpress();">[设置]</a>
                    <p class="notic2">设置常用快递公司</p>
                </dd>
            </dl>

            <div class="hDiv">
                <div class="hDivBox">
                    <table cellspacing="0" cellpadding="0" style="width: 100%">
                        <thead>
                            <tr>
                                <th class="w10"><div class="tc"></div></th>
                                <th class="w10"><div class="tc">注册设置</div></th>
                                <th><div></div></th>
                            </tr>
                        </thead>
                    </table>
                </div>
            </div>
            <dl class="row">
                <dt class="tit"><label for="uname">强制授权登录</label></dt>
                <dd class="opt">
                    <label class="curpoin"><input type="radio" name="users[users_force_login]" value="1" {if condition="!empty($userConfig.users_force_login)"} checked="checked" {/if}/>开启</label>
                    &nbsp;&nbsp;&nbsp;
                    <label class="curpoin"><input type="radio" name="users[users_force_login]" value="0" {if condition="empty($userConfig.users_force_login)"} checked="checked" {/if}/>关闭</label>
                    <p class="notic2">开启强制授权登录时，用户访问商城必须授权后才可进行商城浏览及下单操作。</p>
                    <p class="notic2">系统默认关闭强制授权登录，当触发加入购物车、立即购买、提交表单、领取优惠券时需要获取用户登录信息。</p>
                </dd>
            </dl>

            <div class="hDiv">
                <div class="hDivBox">
                    <table cellspacing="0" cellpadding="0" style="width: 100%">
                        <thead>
                            <tr>
                                <th class="w10"><div class="tc"></div></th>
                                <th class="w10"><div class="tc">订单设置</div></th>
                                <th><div></div></th>
                            </tr>
                        </thead>
                    </table>
                </div>
            </div>
            <dl class="row">
                <dt class="tit"> <label for="order_unpay_close_time">未付款订单</label> </dt>
                <dd class="opt">
                    <input type="text" id="order_unpay_close_time" name="order[order_unpay_close_time]" value="{$userConfig.order_unpay_close_time|default='0'}" maxlength="4" onkeyup="this.value=this.value.replace(/^\D*([0-9]\d*)?.*$/,'$1');"/><span class="ml10">分钟</span>
                    <p class="notic">订单创建后多长时间未付款将自动关闭，订单自动关闭后商品库存将自动补回</span></p>
                    <p class="notic2">0表示不关闭未付款订单</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit"> <label for="order_auto_receipt_time">自动收货</label> </dt>
                <dd class="opt">
                    <input type="text" id="order_auto_receipt_time" name="order[order_auto_receipt_time]" value="{$userConfig.order_auto_receipt_time|default='0'}" maxlength="3" onkeyup="this.value=this.value.replace(/^\D*([0-9]\d*)?.*$/,'$1');"/><span class="ml10">天后</span>
                    <p class="notic">订单发货后自动收货时间</p>
                    <p class="notic2">0表示不自动确认收货</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit"> <label for="order_right_protect_time">售后维权申请</label> </dt>
                <dd class="opt">
                    <input type="text" id="order_right_protect_time" name="order[order_right_protect_time]" value="{$userConfig.order_right_protect_time|default='0'}" maxlength="3" onkeyup="this.value=this.value.replace(/^\D*([0-9]\d*)?.*$/,'$1');"/><span class="ml10">天内</span>
                    <p class="notic">订单确认收货完成后，多长时间内可申请维权</p>
                    <p class="notic2">0表示订单不允许维权，变更设置项不影响已经产生的订单</p>
                </dd>
            </dl>

            <div class="hDiv">
                <div class="hDivBox">
                    <table cellspacing="0" cellpadding="0" style="width: 100%">
                        <thead>
                            <tr>
                                <th class="w10"><div class="tc"></div></th>
                                <th class="w10"><div class="tc">评价设置</div></th>
                                <th ><div></div></th>
                            </tr>
                        </thead>
                    </table>
                </div>
            </div>
            <dl class="row">
                <dt class="tit"> <label>商品评价</label> </dt>
                <dd class="opt">
                    <label> <input type="radio" name="shop[shop_open_comment]" value="1" {if condition="$userConfig.shop_open_comment == 1"} checked="checked" {/if}/>开启 </label>
                    &nbsp;&nbsp;&nbsp;
                    <label> <input type="radio" name="shop[shop_open_comment]" value="0" {if condition="!isset($userConfig.shop_open_comment) || empty($userConfig.shop_open_comment)"} checked="checked" {/if}/>关闭 </label>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit"> <label>评价审核</label> </dt>
                <dd class="opt">
                    <label> <input type="radio" name="shop[shop_open_comment_audit]" value="1" {if condition="$userConfig.shop_open_comment_audit == 1"} checked="checked" {/if}/>开启 </label>
                    &nbsp;&nbsp;&nbsp;
                    <label> <input type="radio" name="shop[shop_open_comment_audit]" value="0" {if condition="$userConfig.shop_open_comment_audit == 0"} checked="checked" {/if}/>关闭 </label>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit"> <label>自动默认评价</label> </dt>
                <dd class="opt">
                    <label> <input type="radio" name="shop[shop_open_default_comment]" value="1" {if condition="$userConfig.shop_open_default_comment == 1"} checked="checked" {/if}/>开启 </label>
                    &nbsp;&nbsp;&nbsp;
                    <label> <input type="radio" name="shop[shop_open_default_comment]" value="0" {if condition="$userConfig.shop_open_default_comment == 0"} checked="checked" {/if}/>关闭 </label>
                    <p class="notic">自动默认评价生成后默认审核通过，在用户端显示</p>
                    <div class="mt10" style="background: rgb(244, 244, 244);border-radius: 8px;">
                        <dl class="row " style="background: rgb(244, 244, 244);border-radius: 8px;">
                            <dt class="tit"><label for="shop_default_comment_time">自动评价时间</label></dt>
                            <dd class="opt">
                                订单完成<input type="text" id="shop_default_comment_time" name="shop[shop_default_comment_time]" value="{$userConfig.shop_default_comment_time|default='7'}" class="input-txt" style="width: 60px !important;" onkeyup="this.value=this.value.replace(/^\D*([0-9]\d*)?.*$/,'$1');">天&nbsp;&nbsp;&nbsp;买家未评价的，自动生成默认五星评价
                                <p class="notic2">自动评价时间支持7-180天</p>
                            </dd>
                        </dl>
                        <dl class="row" style="background: rgb(244, 244, 244);border-radius: 8px;">
                            <dt class="tit"><label for="shop_default_comment_content">默认评价内容</label></dt>
                            <dd class="opt">
                                <textarea rows="5" cols="60" id="shop_default_comment_content" name="shop[shop_default_comment_content]" style="height: 54px;" class="keywordsTextarea">{$userConfig.shop_default_comment_content|default='此用户没有填写评价'}</textarea>
                            </dd>
                        </dl>
                    </div>
                </dd>
            </dl>

            <div class="hDiv">
                <div class="hDivBox">
                    <table cellspacing="0" cellpadding="0" style="width: 100%">
                        <thead>
                            <tr>
                                <th class="w10"><div class="tc"></div></th>
                                <th class="w10"><div class="tc">退货地址</div></th>
                                <th ><div></div></th>
                            </tr>
                        </thead>
                    </table>
                </div>
            </div>
            <dl class="row">
                <dt class="tit"> <label for="addr_contact_person">联系人</label> </dt>
                <dd class="opt">
                    <input type="text" id="addr_contact_person" style="width: 30%;" name="addr[addr_contact_person]" value="{$userConfig.addr_contact_person|default=''}"/>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit"> <label for="addr_contact_phone">联系号码</label> </dt>
                <dd class="opt">
                    <input type="text" id="addr_contact_phone" style="width: 30%;" name="addr[addr_contact_phone]" value="{$userConfig.addr_contact_phone|default=''}" maxlength="11" onkeyup="this.value=this.value.replace(/^\D*([0-9]\d*)?.*$/,'$1');"/>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit"> <label for="addr_shipping_addr">收货地址</label> </dt>
                <dd class="opt">
                    <input type="text" id="addr_shipping_addr" style="width: 30%;" name="addr[addr_shipping_addr]" value="{$userConfig.addr_shipping_addr|default=''}"/>
                </dd>
            </dl>

            <div class="ncap-form-default">
                <div class="bot2 e-l-110">
                    <a href="JavaScript:void(0);" onclick="shopConfig();" class="ncap-btn-big ncap-btn-green w60">保存</a>
                </div>
            </div>
        </form>
    </div>
</div>

<script type="text/javascript">
    $(function() {
        try{
            if (typeof(eval('is_conceal_1649209614'))=="function" && is_conceal_1649209614()){
                $(".page").css("margin-left","");
                $(".page").css("min-width","");
            }else{
                $(".page").css("margin-left","100px");
                $(".page").css("min-width","auto");
            }
        }catch(e){}
    });

    // 设置快递公司
    function selectExpress() {
        var url = "{:url('Shop/order_express', ['select'=>1])}";
        //iframe窗
        layer.open({
            type: 2,
            title: '设置常用快递公司',
            move: false,
            shadeClose: false,
            maxmin: false, //开启最大化最小化按钮
            shade: layer_shade,
            closeBtn: 3,
            area: ['60%', '90%'],
            content: url
        });
    }

    // 判断输入框是否为空
    function shopConfig() {
        layer_loading('正在处理');
        $('#post_form').submit();
    }
</script>
{include file="public/footer" /}